package com.example.dzdph.filter

import com.example.dzdph.service.ui.UiObject

class ActionFilter(private val actions: Array<out Any>) : Filter {
    override fun filter(node: UiObject) = node.hasAction(*actions)

    override fun toString() = when (actions.size) {
        1 -> "action(${actions.joinToString()})"
        else /* including 0. */ -> "action([${actions.joinToString(",")}])"
    }

}